<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'album-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>250)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textField($model,'description',array('size'=>60,'maxlength'=>1000)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>


<?php
if($_GET)
	{
	$con=Photo::getList('ALBUM-LIST', array('photos'=>$model->id)); 

foreach($con as $cont)
{
	$i=1;
 	?>
 	<div>
 		<img src="<?php echo Yii::app()->baseUrl . '/photos/'.$cont->photo_name ?>" height="50px" width="50px" />
 		 
 		
 		 <input type="radio" name="radio1" value="<?php echo $cont->id ?>" checked />Album cover
 		 
 		 <a href="<?php echo Yii::app()->createUrl('admin/photo/delete/id/'.$cont->id.'/aid/'.$model->id) ?>" ><img src="<?php echo Yii::app()->baseUrl . '/images/delete.png' ?>"></a>

 	</div>

<?php
$i++;
}
}
	?>
	
	<div class="row buttons">
		<?php if($model->id!=NULL) {?>
		<a class="row buttons" href="<?php echo Yii::app()->createUrl('admin/photo/create/id/'.$model->id) ?>"> Add more </a>
		<?php }
		echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->